import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

enum FormType {
  text,
  field,
}

class FormCell extends StatefulWidget {
  final String? title;
  final String? hintText;
  final bool? isShowArrow;
  FormType? formType = FormType.text;
  final GestureTapCallback? onTap;

  FormCell({
    super.key,
    required this.title,
    this.hintText,
    this.isShowArrow,
    this.formType,
    this.onTap,
  }) : assert(title != null, "title 不能为空");

  @override
  State<StatefulWidget> createState() {
    return _FormCellState();
  }
}

class _FormCellState extends State<FormCell> {
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
        onTap: widget.onTap,
        onTapCancel: () {},
        onTapDown: (TapDownDetails details) {},
        child: Container(
          padding: EdgeInsets.only(left: 24.w, right: 24.w),
          decoration: BoxDecoration(
              color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
          height: 96.h,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              // left
              Row(
                children: [
                  //image
                  // Image(
                  //   image: AssetImage(widget.imageName!),
                  //   width: 48.h,
                  //   height: 48.h,
                  // ),
                  const SizedBox(
                    width: 16,
                  ),
                  //title
                  Text(
                    widget.title!,
                    style: TextStyle(
                        color: const Color(0xff333333), fontSize: 32.sp),
                  ),
                ],
              ),
              // right
              Row(
                children: [
              // subtitle
              // Text(widget.subTitle ?? ""),
              // // subimage
              // widget.subImageName != null
              //     ? Image(
              //   image: AssetImage(widget.subImageName!),
              //   width: 24,
              // )
              //     : Container(),
              //箭头
              Image(
                image: const AssetImage(
                    'assets/images/icon_segue_arrow_grey.png'),
                width: 48.h,
                height: 48.h,
                fit: BoxFit.contain,
              ),
                ],
              ),
            ],
          ),
        ));
  }
}
